package atguigu;

import com.atguigu.ext.ExtConfig;
import org.junit.Test;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Service;

/**
 * @author gcq
 * @Create 2021-02-08
 */
@Service
public class IOCTest_Ext {

    @Test
    public void test() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ExtConfig.class);

        context.publishEvent(new ApplicationEvent("这是一个事件") {
        });
        context.close();
    }
}